import 'package:aio/aio.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/url.dart';

///产品信息
class Product extends BaseBean {
  String? ProductId = ""; //产品编号
  String? ProductName = ""; //产品名称
  String? SecondName = ""; //合同产品扩展名
  String getProductName() {
    if (StringUtils.isNotEmpty(SecondName)) {
      return "$ProductName($SecondName)";
    }
    return ProductName ?? "";
  }

  String? BigClass = ""; //产品大类
  String? ProductClass = ""; //产品类型
  String? ProductClassName = ""; //产品类型名称
  String? ProductPrice = ""; //产品单价
  String? PriceUnitName = ""; //计价单位名称
  String? AbnormityArea = ""; //异性面积
  String? CurrencyType = ""; //货币种类
  String? TaxCode = ""; //税码
  String? TaxRate = ""; //税率
  String? DrillHolePrice = ""; //打孔单价
  String? AccountMethods = ""; //结算要求
  String? PdOrderArea = ""; //下单面积
  String? PdContractArea = ""; //产品面积
  String? InitOrderedArea = ""; //期初面积
  String? MinusArea = ""; //减稠面积
  String? PdOdQuotient = ""; //面积占比
  String? GasType = ""; //充气类型
  String? GlueType = ""; //密封胶
  String? GlueName = ""; //胶水名称
  String? GlueBrand = ""; //胶水品牌
  String? GlueDeepType = ""; //中空胶深
  String? OtherGlueDeep = ""; //胶深数值
  String? GluDeepRule = ""; //胶深数值(查看规则)，之前没有，钱瑞淼 在提成比例合同信息里补上去了。
  String? IsPumpArgon = ""; //是否冲氮气
  String? DistinctSize = ""; //是否大小片(0和1)；大小错片
  String? DistinctSizeName = ""; //是否大小片（是和否）
  ///是否大小片
  bool isDistinctSize() {
    return BoolUtils.isBoolWithStr(DistinctSize);
  }

  String? IsAbnormity = ""; //是否异形
  String? BendingSteelType = ""; //钢化类型
  String? StructureContent = ""; //产品说明(产品备注)
  String? IsGrid = ""; //是否格栅
  String? FilmType = ""; //贴膜类型
  String? QualityType = ""; //质量标准
  String? PrintType = ""; //打印要求
  String? DeliveryAddress = ""; //送货地点
  String? FactoryName = ""; //生产工厂
  String? MinLengthC = ""; //长边限制最小值
  String? MaxLengthC = ""; //长边限制最大值
  String? LengthC = ""; //长边限制
  String? MinLengthD = ""; //短边限制最小值
  String? MaxLengthD = ""; //短边限制最大值
  String? LengthD = ""; //短边限制
  String? BendType = ""; //铝条折弯
  String? ProcessList = ""; //工艺路线
  List<List<String>>? _ProcessList = null;

  List<List<String>>? getProcessList() {
    if (_ProcessList == null && StringUtils.isNotEmpty(ProcessList)) {
      _ProcessList = [];
      //ProcessList="切割(来料)/粗磨(来料)/夹胶（高压）/中空/水刀/+/切割(来料)/粗磨夹胶(来料)/夹胶（高压）/中空/水刀/+/切割/粗磨/"
      ProcessList?.split("+")?.forEach((element) {
        List<String> _list = [];
        element?.split("/")?.forEach((element) {
          if (element.trim().length > 0) {
            _list?.add(element.trim());
          }
        });
        _list?.remove(""); //移除空的
        _list?.remove(" "); //移除空格
        if (_list.length > 0) {
          _ProcessList?.add(_list);
        }
      });
    }
    return _ProcessList;
  }

  String? ProductCustomerName = ""; //客户产品名称
  String? ProductEnglishName = ""; //特殊产品名称
  List<List<ProductStructureLayerInfo>>? ProcessInfoList = []; //工艺信息
  String? MoreProductArea = ""; //是否超出产品面积
  bool isMoreProductArea() {
    return BoolUtils.isBoolWithStr(MoreProductArea);
  }

  /**
   * fixme 订单新增
   */

  String? OrderCode = ""; //订单编号
  String? OrderOutCode = ""; //订单外部编号（外部编号）
  String? PoCode = ""; //批次号
  String? OrderProjectName = ""; //订单项目名称
  String? CustomerDate = ""; //客户下单日期
  String? DeliverDateDay = ""; //日期格式的交货日期
  String? AddDate = ""; //录入日期
  String? PackageType = ""; //包装要求
  String? MerchandiserName = ""; //跟单员姓名(客服经理)
  String? SalesmanName = ""; //业务员姓名(销售经理)
  String? PriorityType = ""; //优先等级
  String? IsYp = ""; //大样小样
  String? IsSubmit = ""; //质检提交合格
  String? IsForeign = ""; //是否外贸
  String? OrderClass = ""; //订单类型
  String? ProdDeptId = ""; //生产部门Id
  String? ProdDeptName = ""; //生产部门名称
  String? MaterialCode = ""; //物料编号(物料编码)
  String? NonProduce = ""; //是否需要生产（若不需要生产的，则审核通过后自动变成生产完成状态，并允许从无主库存直接申请发货）
  String? AllOutProduce = ""; //是否全委外（没有逻辑控制，目前只需要显示给在线优化的人看，以免误优化进去）
  String? AdgeSeatType = ""; //磨边位置（是否打孔）
  String? AdgeSeatTypeName = ""; //是否打孔
  ///判断是否打孔
  bool isAdgeSeatType() {
    return BoolUtils.isBoolWithStr(AdgeSeatType);
  }

  String? IsDigChipName = ""; //是否挖缺
  ///判断是否挖缺
  bool isDigChipName() {
    return BoolUtils.isBoolWithStr(IsDigChipName);
  }

  String? IsWaterTrough = ""; //是否卡槽
  String? AllCheck = ""; //是否全检（全部检验）
  String? FxIntro = ""; //FxIntro分箱备注
  String? ZlIntro = ""; //ZlIntro质量备注
  String? JsIntro = ""; //JsIntro技术备注
  String? ItemIntro = ""; //备注(其他备注)；错了。这个是 条目备注。
  String? Status = ""; //审核状态 -1：审核不通过,0：暂存，1：审核中，
  String? StatusName = ""; //": "待审核",
  ///获取审核状态
  String getStatusName(BuildContext context) {
    if (StringUtils.isNotEmpty(StatusName)) {
      return StatusName!;
    }
    if (StringUtils.isNotEmpty(Status)) {
      if (Status == "-1") {
        return AppStrings.of(context).StatusFailure; //审核不通过
      } else if (Status == "0") {
        //暂存
      } else if (Status == "1") {
        return AppStrings.of(context).Statusing; //审核中
      } else if (Status == "2") {
        return AppStrings.of(context).StatusSuccess; //审核通过
      }
    }
    return "";
  }

  String? OrderType = ""; //审核状态编码；订单状态
  String? OrderTypeName = ""; //审核状态名称

  ///获取审核状态
  String getOrderOrStatusName() {
    //审核状态
    if (StringUtils.isNotEmpty(StatusName)) {
      return StatusName!;
    }
    //订单审核状态（用于订单审核）
    if (StringUtils.isNotEmpty(OrderTypeName)) {
      return OrderTypeName!;
    }
    //审核状态
    if (StringUtils.isNotEmpty(OrderType)) {
      return OrderType!;
    }
    //审核状态
    if (StringUtils.isNotEmpty(Status)) {
      return Status!;
    }
    return "";
  }

  ///判断产品是否正在生产中,生产中，需要显示架卡进度。
  bool isProduting() {
    var str = getOrderOrStatusName();
    if (str != null &&
        str.contains("生产中") &&
        StringUtils.isNotEmpty(OrderShelfStat?.ShelfStatList)) {
      //return true;
      var hSize = OrderShelfStat?.HeaderNames?.length ?? 0;
      var list = OrderShelfStat?.ShelfStatList;
      if (list != null && list.length > 0) {
        var b = true;
        list?.forEach((element) {
          var size = element.ProcessData?.length ?? 0;
          if (hSize != size) {
            //fixme 防止头部字段和内容字段个数不一致。
            b = false;
          }
        });
        return b;
      }
    }
    return false;
  }

  String? ContractId = ""; //合同副本编号
  String? ContractCode = ""; //合同编号
  String? OutCode = ""; //合同外部编号
  String? ProjectName = ""; //项目名称
  String? CustomerName = ""; //客户名称
  String? TotalMeter = ""; //周长合计
  String? TotalSize = ""; //面积合计
  String? TotalPNum = ""; //片数合计
  String? TotalJsSize = ""; //结算合计
  String? Summation = ""; //条目合计(周长合计;面积合计;片数合计;结算合计),有了上面四个合计，这个就不需要了。
  String? OrderContent = ""; //订单说明；订单备注，或 其他备注
  ProductOrderShelfStat? OrderShelfStat = null; //订单架卡进度
  String? ParentProductId = ""; //从属id

  //判断是否从属
  bool isParentProduct() {
    // return true;//测试
    //print("===================================是否从属:${ParentProductId}");
    ///这个判断条件改成了和服务器端一样的判断
    if (ParentProductId == null ||
        ParentProductId == "0" ||
        ParentProductId?.trim() == "") {
      return false; //不是从属
    } else {
      return true; //是从属
    }
    // if (ParentProductId != null && ParentProductId!.trim() != "0") {
    //   return true; //从属
    // }
    // return false;
  }

  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    ProductId = json['ProductId']?.toString() ?? "";
    ProductName = json['ProductName']?.toString() ?? "";
    SecondName = json['SecondName']?.toString() ?? "";
    BigClass = json['BigClass']?.toString() ?? "";
    ProductClass = json['ProductClass']?.toString() ?? "";
    ProductClassName = json['ProductClassName']?.toString() ?? "";
    ProductPrice = json['ProductPrice']?.toString() ?? "";
    PriceUnitName = json['PriceUnitName']?.toString() ?? "";
    AbnormityArea = json['AbnormityArea']?.toString() ?? "";
    CurrencyType = json['StatusDescription']?.toString() ?? "";
    Status = json['Status']?.toString() ?? "";
    TaxCode = json['TaxCode']?.toString() ?? "";
    TaxRate = json['TaxRate']?.toString() ?? "";
    DrillHolePrice = json['DrillHolePrice']?.toString() ?? "";
    AccountMethods = json['AccountMethods']?.toString() ?? "";
    PdOrderArea = json['PdOrderArea']?.toString() ?? "";
    PdContractArea = json['PdContractArea']?.toString() ?? "";
    MinusArea = json['MinusArea']?.toString() ?? "";
    PdOdQuotient = json['PdOdQuotient']?.toString() ?? "";
    GasType = json['GasType']?.toString() ?? "";
    GlueType = json['GlueType']?.toString() ?? "";
    GlueName = json['GlueName']?.toString() ?? "";
    GlueBrand = json['GlueBrand']?.toString() ?? "";
    GlueDeepType = json['GlueDeepType']?.toString() ?? "";
    OtherGlueDeep = json['OtherGlueDeep']?.toString() ?? "";
    IsPumpArgon = json['IsPumpArgon']?.toString() ?? "";
    DistinctSize = json['DistinctSize']?.toString() ?? "";
    DistinctSizeName = json['DistinctSizeName']?.toString() ?? "";
    IsAbnormity = json['IsAbnormity']?.toString() ?? "";
    BendingSteelType = json['BendingSteelType']?.toString() ?? "";
    StructureContent = json['StructureContent']?.toString() ?? "";
    IsGrid = json['IsGrid']?.toString() ?? "";
    FilmType = json['FilmType']?.toString() ?? "";
    QualityType = json['QualityType']?.toString() ?? "";
    PrintType = json['PrintType']?.toString() ?? "";
    DeliveryAddress = json['DeliveryAddress']?.toString() ?? "";
    FactoryName = json['FactoryName']?.toString() ?? "";
    MinLengthC = json['MinLengthC']?.toString() ?? "";
    MaxLengthC = json['MaxLengthC']?.toString() ?? "";
    LengthC = json['LengthC']?.toString() ?? "";
    MinLengthD = json['MinLengthD']?.toString() ?? "";
    MaxLengthD = json['MaxLengthD']?.toString() ?? "";
    LengthD = json['LengthD']?.toString() ?? "";
    BendType = json['BendType']?.toString() ?? "";
    ProcessList = json['ProcessList']?.toString() ?? "";
    ProductCustomerName = json['ProductCustomerName']?.toString() ?? "";
    ProductEnglishName = json['ProductEnglishName']?.toString() ?? "";
    List<List<ProductStructureLayerInfo>>? list = [];
    ProcessInfoList = setGenericFromJsonWithListAtList(
        json, "ProcessInfoList", list, ProductStructureLayerInfo());
    // ProcessInfoList?.forEach((element) {
    //   element.forEach((element2) {
    //     print("名称"+element2.StructureLId.toString());
    //   });
    // });
    MoreProductArea = json['MoreProductArea']?.toString() ?? "";
    OrderCode = json['OrderCode']?.toString() ?? "";
    OrderOutCode = json['OrderOutCode']?.toString() ?? "";
    PoCode = json['PoCode']?.toString() ?? "";
    OrderProjectName = json['OrderProjectName']?.toString() ?? "";
    CustomerDate = json['CustomerDate']?.toString() ?? "";
    DeliverDateDay = json['DeliverDateDay']?.toString() ?? "";
    AddDate = json['AddDate']?.toString() ?? "";
    PackageType = json['PackageType']?.toString() ?? "";
    MerchandiserName = json['MerchandiserName']?.toString() ?? "";
    SalesmanName = json['SalesmanName']?.toString() ?? "";
    PriorityType = json['PriorityType']?.toString() ?? "";
    IsYp = json['IsYp']?.toString() ?? "";
    IsSubmit = json['IsSubmit']?.toString() ?? "";
    IsForeign = json['IsForeign']?.toString() ?? "";
    OrderClass = json['OrderClass']?.toString() ?? "";
    ProdDeptId = json['ProdDeptId']?.toString() ?? "";
    ProdDeptName = json['ProdDeptName']?.toString() ?? "";
    MaterialCode = json['MaterialCode']?.toString() ?? "";
    NonProduce = json['NonProduce']?.toString() ?? "";
    AllOutProduce = json['AllOutProduce']?.toString() ?? "";
    AdgeSeatType = json['AdgeSeatType']?.toString() ?? "";
    AdgeSeatTypeName = json['AdgeSeatTypeName']?.toString() ?? "";
    IsDigChipName = json['IsDigChipName']?.toString() ?? "";
    IsWaterTrough = json['IsWaterTrough']?.toString() ?? "";
    AllCheck = json['AllCheck']?.toString() ?? "";
    FxIntro = json['FxIntro']?.toString() ?? "";
    ZlIntro = json['ZlIntro']?.toString() ?? "";
    JsIntro = json['JsIntro']?.toString() ?? "";
    ItemIntro = json['ItemIntro']?.toString() ?? "";
    StatusName = json['StatusName']?.toString() ?? "";
    OrderType = json['OrderType']?.toString() ?? "";
    OrderTypeName = json['OrderTypeName']?.toString() ?? "";
    ContractId = json['ContractId']?.toString() ?? "";
    ContractCode = json['ContractCode']?.toString() ?? "";
    OutCode = json['OutCode']?.toString() ?? "";
    ProjectName = json['ProjectName']?.toString() ?? "";
    CustomerName = json['CustomerName']?.toString() ?? "";
    TotalMeter = json['TotalMeter']?.toString() ?? "";
    TotalSize = json['TotalSize']?.toString() ?? "";
    TotalPNum = json['TotalPNum']?.toString() ?? "";
    TotalJsSize = json['TotalJsSize']?.toString() ?? "";
    Summation = json['Summation']?.toString() ?? "";
    OrderContent = json['OrderContent']?.toString() ?? "";
    OrderShelfStat =
        setGenericFromJson(json, "OrderShelfStat", ProductOrderShelfStat(), "");
    ParentProductId = json['ParentProductId']?.toString() ?? "";
    InitOrderedArea = json['InitOrderedArea']?.toString() ?? "";
    GluDeepRule = json['GluDeepRule']?.toString() ?? "";
  }

  @override
  instance() {
    // TODO: implement instance
    return Product();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    var map = <String, dynamic>{};
    map["ProductId"] = ProductId;
    map["ProductName"] = ProductName;
    map["SecondName"] = SecondName;
    map["BigClass"] = BigClass;
    map["ProductClass"] = ProductClass;
    map["ProductClassName"] = ProductClassName;
    map["ProductPrice"] = ProductPrice;
    map["PriceUnitName"] = PriceUnitName;
    map["AbnormityArea"] = AbnormityArea;
    map["CurrencyType"] = CurrencyType;
    map["Status"] = Status;
    map["TaxCode"] = TaxCode;
    map["TaxRate"] = TaxRate;
    map["DrillHolePrice"] = DrillHolePrice;
    map["AccountMethods"] = AccountMethods;
    map["PdOrderArea"] = PdOrderArea;
    map["PdContractArea"] = PdContractArea;
    map["MinusArea"] = MinusArea;
    map["PdOdQuotient"] = PdOdQuotient;
    map["GasType"] = GasType;
    map["GlueType"] = GlueType;
    map["GlueName"] = GlueName;
    map["GlueBrand"] = GlueBrand;
    map["GlueDeepType"] = GlueDeepType;
    map["OtherGlueDeep"] = OtherGlueDeep;
    map["IsPumpArgon"] = IsPumpArgon;
    map["DistinctSize"] = DistinctSize;
    map["DistinctSizeName"] = DistinctSizeName;
    map["IsAbnormity"] = IsAbnormity;
    map["BendingSteelType"] = BendingSteelType;
    map["StructureContent"] = StructureContent;
    map["IsGrid"] = IsGrid;
    map["FilmType"] = FilmType;
    map["QualityType"] = QualityType;
    map["PrintType"] = PrintType;
    map["DeliveryAddress"] = DeliveryAddress;
    map["FactoryName"] = FactoryName;
    map["MinLengthC"] = MinLengthC;
    map["MaxLengthC"] = MaxLengthC;
    map["LengthC"] = LengthC;
    map["MinLengthD"] = MinLengthD;
    map["MaxLengthD"] = MaxLengthD;
    map["LengthD"] = LengthD;
    map["BendType"] = BendType;
    map["ProcessList"] = ProcessList;
    map["ProductCustomerName"] = ProductCustomerName;
    map["ProductEnglishName"] = ProductEnglishName;
    map["ProcessInfoList"] = ProcessInfoList;
    map["MoreProductArea"] = MoreProductArea;
    map["OrderCode"] = OrderCode;
    map["OrderOutCode"] = OrderOutCode;
    map["PoCode"] = PoCode;
    map["OrderProjectName"] = OrderProjectName;
    map["CustomerDate"] = CustomerDate;
    map["DeliverDateDay"] = DeliverDateDay;
    map["AddDate"] = AddDate;
    map["PackageType"] = PackageType;
    map["MerchandiserName"] = MerchandiserName;
    map["SalesmanName"] = SalesmanName;
    map["PriorityType"] = PriorityType;
    map["IsYp"] = IsYp;
    map["IsSubmit"] = IsSubmit;
    map["IsForeign"] = IsForeign;
    map["OrderClass"] = OrderClass;
    map["ProdDeptId"] = ProdDeptId;
    map["ProdDeptName"] = ProdDeptName;
    map["MaterialCode"] = MaterialCode;
    map["NonProduce"] = NonProduce;
    map["AllOutProduce"] = AllOutProduce;
    map["AdgeSeatType"] = AdgeSeatType;
    map["AdgeSeatTypeName"] = AdgeSeatTypeName;
    map["IsDigChipName"] = IsDigChipName;
    map["IsWaterTrough"] = IsWaterTrough;
    map["AllCheck"] = AllCheck;
    map["FxIntro"] = FxIntro;
    map["ZlIntro"] = ZlIntro;
    map["JsIntro"] = JsIntro;
    map["ItemIntro"] = ItemIntro;
    map["StatusName"] = StatusName;
    map["OrderType"] = OrderType;
    map["OrderTypeName"] = OrderTypeName;
    map["ContractId"] = ContractId;
    map["ContractCode"] = ContractCode;
    map["OutCode"] = OutCode;
    map["ProjectName"] = ProjectName;
    map["CustomerName"] = CustomerName;
    map["TotalMeter"] = TotalMeter;
    map["TotalSize"] = TotalSize;
    map["TotalPNum"] = TotalPNum;
    map["TotalJsSize"] = TotalJsSize;
    map["Summation"] = Summation;
    map["OrderContent"] = OrderContent;
    map["OrderShelfStat"] = OrderShelfStat;
    map["ParentProductId"] = ParentProductId;
    map["InitOrderedArea"] = InitOrderedArea;
    map["GluDeepRule"] = GluDeepRule;
    return map;
  }
}

///工业信息
class ProductStructureLayerInfo extends BaseBean {
  String? StructureLId = ""; //层数Id
  String? ProductId = ""; //结构编号（合同产品编号）
  String? TemplateNum = ""; //层次序号
  String? GlassType = ""; //原片类型
  String? GlassId = ""; //原料编号
  String? GlassName = ""; //原料名称
  String? GlassThin = ""; //原片厚度
  String? ProcessList = ""; //工艺路线
  String? AdgeRequire = ""; //磨边要求
  String? ManufacturerId = ""; //品牌Id
  String? ManufacturerName = ""; //品牌名称
  String? QualityGrade = ""; //原片质量等级
  String? BrandCoat = ""; //镀膜牌号
  String? BrandCoatPosition = ""; //镀膜位置
  String? GlazeBrandCoatId = ""; //彩釉Id
  String? GlazeBrandCoatName = ""; //彩釉名称
  String? GlazeBrandCoatPosition = ""; //彩釉位置
  String? BrandRequire = ""; //商标
  String? BrandRequirePosition = ""; //商标位置
  String? FrostPosition = ""; //磨砂位置
  String? FilmPosition = ""; //贴膜位置
  String? BrandRequireImg = ""; //商标图片

  ///获取商标图片地址
  String? getBrandRequireImgPath() {
    return Url.getFileUrl(BrandRequireImg);
  }

  ///打开商标图片
  void openBrandRequireImg(BuildContext context) {
    FileUtils.openFile(context, Url.getFileUrl(getBrandRequireImgPath()));
  }

  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    StructureLId = json['StructureLId']?.toString() ?? "";
    ProductId = json['ProductId']?.toString() ?? "";
    TemplateNum = json['TemplateNum']?.toString() ?? "";
    GlassType = json['GlassType']?.toString() ?? "";
    GlassId = json['GlassId']?.toString() ?? "";
    GlassName = json['GlassName']?.toString() ?? "";
    //print("名称：\t"+GlassName.toString());
    GlassThin = json['GlassThin']?.toString() ?? "";
    ProcessList = json['ProcessList']?.toString() ?? "";
    AdgeRequire = json['AdgeRequire']?.toString() ?? "";
    ManufacturerId = json['ManufacturerId']?.toString() ?? "";
    ManufacturerName = json['ManufacturerName']?.toString() ?? "";
    QualityGrade = json['QualityGrade']?.toString() ?? "";
    BrandCoat = json['BrandCoat']?.toString() ?? "";
    BrandCoatPosition = json['BrandCoatPosition']?.toString() ?? "";
    GlazeBrandCoatId = json['GlazeBrandCoatId']?.toString() ?? "";
    GlazeBrandCoatName = json['GlazeBrandCoatName']?.toString() ?? "";
    GlazeBrandCoatPosition = json['GlazeBrandCoatPosition']?.toString() ?? "";
    BrandRequire = json['BrandRequire']?.toString() ?? "";
    BrandRequirePosition = json['BrandRequirePosition']?.toString() ?? "";
    FrostPosition = json['FrostPosition']?.toString() ?? "";
    FilmPosition = json['FilmPosition']?.toString() ?? "";
    BrandRequireImg = json['BrandRequireImg']?.toString() ?? "";
  }

  @override
  instance() {
    // TODO: implement instance
    return ProductStructureLayerInfo();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    var map = <String, dynamic>{};
    map["StructureLId"] = StructureLId;
    map["ProductId"] = ProductId;
    map["TemplateNum"] = TemplateNum;
    map["GlassType"] = GlassType;
    map["GlassId"] = GlassId;
    map["GlassName"] = GlassName;
    map["GlassThin"] = GlassThin;
    map["ProcessList"] = ProcessList;
    map["AdgeRequire"] = AdgeRequire;
    map["ManufacturerId"] = ManufacturerId;
    map["ManufacturerName"] = ManufacturerName;
    map["QualityGrade"] = QualityGrade;
    map["BrandCoat"] = BrandCoat;
    map["BrandCoatPosition"] = BrandCoatPosition;
    map["GlazeBrandCoatId"] = GlazeBrandCoatId;
    map["GlazeBrandCoatName"] = GlazeBrandCoatName;
    map["GlazeBrandCoatPosition"] = GlazeBrandCoatPosition;
    map["BrandRequire"] = BrandRequire;
    map["BrandRequirePosition"] = BrandRequirePosition;
    map["FrostPosition"] = FrostPosition;
    map["FilmPosition"] = FilmPosition;
    map["BrandRequireImg"] = BrandRequireImg;
    return map;
  }
}

///订单架卡进度
class ProductOrderShelfStat extends BaseBean {
  List<ShelfStat>? ShelfStatList = null; //架卡进度列表
  List<String>? HeaderNames = null; //表头名称
  List<String>? CombineDatas = null; //合计数据；第一个合计是数量合计，后面的是工序合计。

  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    ShelfStatList =
        setGenericFromJson(json, "ShelfStatList", <ShelfStat>[], ShelfStat());
    HeaderNames = setGenericFromJson(json, "HeaderNames", <String>[], "");
    CombineDatas = setGenericFromJson(json, "CombineDatas", <String>[], "");
  }

  @override
  instance() {
    // TODO: implement instance
    return ProductOrderShelfStat();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    var map = <String, dynamic>{};
    map["ShelfStatList"] = ShelfStatList;
    map["HeaderNames"] = HeaderNames;
    map["CombineDatas"] = CombineDatas;
    return map;
  }
}

///架卡进度
class ShelfStat extends BaseBean {
  String? LevelShelfId = ""; //架卡编号
  String? PlanGradeName = ""; //生产等级
  String? ItemQuantity = ""; //数量
  String? ProcessName = ""; //当前工序
  String? StartDate = ""; //排产日期
  List<String>? ProcessData = null; //工艺数据

  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    LevelShelfId = json['LevelShelfId']?.toString() ?? "";
    PlanGradeName = json['PlanGradeName']?.toString() ?? "";
    ItemQuantity = json['ItemQuantity']?.toString() ?? "";
    ProcessName = json['ProcessName']?.toString() ?? "";
    StartDate = json['StartDate']?.toString() ?? "";
    //print("架卡数据：\t${json['ProcessData']}");
    ProcessData = setGenericFromJson(json, "ProcessData", <String>[], "");
  }

  @override
  instance() {
    // TODO: implement instance
    return ShelfStat();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    var map = <String, dynamic>{};
    map["LevelShelfId"] = LevelShelfId;
    map["PlanGradeName"] = PlanGradeName;
    map["ItemQuantity"] = ItemQuantity;
    map["ProcessName"] = ProcessName;
    map["StartDate"] = StartDate;
    map["ProcessData"] = ProcessData;
    return map;
  }
}
